/** @file HelpPage.qml
@brief The help page of the application.

@authorname \n
@licenseversion \n
@actualversion - @dateupdate

@licensenote
*/

import QtQuick 1.0
import com.nokia.symbian 1.0
import "QtComplex" as Framework
import "QtComplex/Tools.js" as QTCtools
import "BlackCat.js" as BCCS

Page {
    id: helpPage
    tools: commonTools

    Framework.ComplexItem {
        id: qtComplex
        theme: "bccs"
        screenCategory: screen.displayCategory;
    }

    // Background
    Rectangle {
        id: background

        width: helpPage.width
        height: helpPage.height
        color: QTCtools.light
    }

    // This object is needed to animate the second level toolbar.
    Rectangle {
        id: toolbar_background
        width: helpPage.width
        height: QTCtools.getToolbarHeight(parent.height)
    }

    HelpToolbar {
        id: main_tb
        width: parent.width
        height: parent.height
        anchors.top: parent.top

        onToolbarEvent: {
            console.log("Clicked help button "+ button)
            if (button == 1)
                helpView.url = "https://projects.developer.nokia.com/blackcatcuttingstudio";
            if (button == 2)
                helpView.url = "https://projects.developer.nokia.com/blackcatcuttingstudio/wiki/DrawingGuide";
            if (button == 3)
                helpView.url = "https://projects.developer.nokia.com/blackcatcuttingstudio/wiki/CuttingGuide";
            if (button == 4)
                helpView.url = "https://projects.developer.nokia.com/blackcatcuttingstudio/wiki/ToolsGuide";
            if (button == 5)
                helpView.url = "https://projects.developer.nokia.com/blackcatcuttingstudio/wiki/CuttersGuide";
            if (button == 6)
                helpView.url = "https://projects.developer.nokia.com/blackcatcuttingstudio/wiki/InfoPage";
            if (button == 7)
                helpView.url = "https://projects.developer.nokia.com/blackcatcuttingstudio/wiki/UserGuide";
            if (button == 8)
                helpView.url = "https://projects.developer.nokia.com/blackcatcuttingstudio/wiki/SetupGuide";
        }
    }

    WebView {
        id: helpView

        width: parent.width
        height: parent.height - toolbar_background.height
        anchors.top: toolbar_background.bottom
        url: "https://projects.developer.nokia.com/blackcatcuttingstudio/wiki/UserGuide"
    }
}
